home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
hity wydania
/
trueSpace 7.6
/
tS761B8Std.exe
/
{app}
/
Scripts
/
MaterialEditor
/
BricksHidden
/
Attenuation.Brick.xml
next >
Wrap
Extensible Markup Language
|
2008-06-10
|
1KB
|
17 lines
<?xml version="1.0" encoding="utf-8" ?>
<ME_BRICK GUID="{BA530DE1-4BB3-4241-BE4A-4A323A903979}" Name="RtUAttenuation" GUIName="Attenuation" Description="Attenuation computation">
<ME_BRICK_INPUTPARAM GUID="{326DA0F5-434B-4FFC-803C-2F66B15CDA0F}" Name="Constant" Type="RtFloat"/>
<ME_BRICK_INPUTPARAM GUID="{35045B24-4132-45AF-A572-5326792B8CB6}" Name="Linear" Type="RtFloat"/>
<ME_BRICK_INPUTPARAM GUID="{23A30651-4ED9-484D-9859-13E962BC8B50}" Name="Cubic" Type="RtFloat"/>
<ME_BRICK_INPUTPARAM GUID="{A77FE343-57D8-4F52-BAEC-E2EC6B5D1A42}" Name="Distance" Type="RtFloat"/>
<ME_BRICK_OUTPUTPARAM GUID="{61797E83-8B7F-4C70-A7C5-986EDFDA0ED1}" Name="FinalIntensity" Type="RtFloat"/>
<ME_BRICK_CODE><![CDATA[
//The attenuation parameter
void RtUAttenuation(in RtFloat Constant, in RtFloat Linear, in RtFloat Cubic, in RtFloat Distance, out RtFloat FinalIntensity)
{
RtFloat fAdd = rtx_Dot(RtFloat3(Constant, Linear, Cubic), RtFloat3(1.0f, Distance, Distance * Distance));
FinalIntensity = (fAdd <= 0) ? 1.0f : 1.0f / fAdd;
}
]]></ME_BRICK_CODE>
</ME_BRICK>